<template>  <!--审核详情-->
  <el-dialog
    :title="!dataForm.receiveId ? '审核详情记录' : '审核详情记录'"
    :close-on-click-modal="false"o
    :visible.sync="visible">
    <el-divider content-position="left">
      <h3>资产领用信息</h3>
    </el-divider>
    <el-form :model="dataForm" ref="dataForm" class="wds-form-top" label-width="150px">
      <el-row class="wds-frame">
        <el-row class="wds-el-row" type="flex">
          <el-col :span="12">
            <div class="wds-frame-l">
              <div class="wds-bj"></div>
              <el-form-item class="wds-frame-form-item" label="资产名" prop="assetsName">
                {{dataForm.assetsName}}
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="12">
            <div class="wds-frame-l">
              <div class="wds-bj"></div>
              <el-form-item class="wds-frame-form-item" label="资产编号" >
                {{dataForm.assetsNum}}
              </el-form-item>
            </div>
          </el-col>
        </el-row>
        <el-row class="wds-el-row" type="flex">
          <el-col :span="24">
            <div class="wds-frame-l">
              <div class="wds-bj"></div>
              <el-form-item class="wds-frame-form-item" label="使用人" prop="assetsAdmin">
                {{dataForm.userName}}
              </el-form-item>
            </div>
          </el-col>
        </el-row>
        <el-row class="wds-el-row" type="flex">
          <el-col :span="12">
            <div class="wds-frame-l">
              <div class="wds-bj"></div>
              <el-form-item class="wds-frame-form-item" label="资产状态" prop="minPay">
                <el-tag  v-if="dataForm.createStatus == 0">审核中/领用</el-tag>
                <el-tag  v-if="dataForm.createStatus == 3">审核中/报修</el-tag>
                <el-tag type="success" v-if="dataForm.createStatus == 1">使用中</el-tag>
                <el-tag type="warning" v-if="dataForm.createStatus == 2">维修中</el-tag>
                <el-tag type="danger" v-if="dataForm.createStatus == 7">已报废</el-tag>
                <el-tag type="info" v-if="dataForm.createStatus == 4">不同意/领用</el-tag>  <!--领用失败-->
                <el-tag type="danger" v-if="dataForm.createStatus == 5">不同意/维修</el-tag>
                <el-tag type="info" v-if="dataForm.createStatus == 6">已归还</el-tag>
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="12">
            <div class="wds-frame-l">
              <div class="wds-bj"></div>
              <el-form-item class="wds-frame-form-item" label="报废日期" prop="interviewStatus">
                {{dataForm.scrapTime}}
              </el-form-item>
            </div>
          </el-col>
        </el-row>
        <el-row class="wds-el-row" type="flex">
          <el-col :span="12">
            <div class="wds-frame-l">
              <div class="wds-bj"></div>
              <el-form-item class="wds-frame-form-item" label="领用日期">
                {{dataForm.receiveTime}}
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="12">
            <div class="wds-frame-l">
              <div class="wds-bj"></div>
              <el-form-item class="wds-frame-form-item" label="申请领用说明" prop="signInTime">
                {{dataForm.receiveDesc}}
              </el-form-item>
            </div>
          </el-col>
        </el-row>
        <el-row class="wds-el-row" type="flex">
          <el-col :span="12">
            <div class="wds-frame-l">
              <div class="wds-bj"></div>
              <el-form-item class="wds-frame-form-item" label="领用审核人" prop="interviewStatus">
                {{dataForm.createBy}}
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="12">
            <div class="wds-frame-l">
              <div class="wds-bj"></div>
              <el-form-item class="wds-frame-form-item" label="领用审核时间" prop="interviewScore">
                {{dataForm.createTime}}
              </el-form-item>
            </div>
          </el-col>
        </el-row>
        <el-row class="wds-el-row" type="flex">
          <el-col :span="24">
            <div class="wds-frame-l">
              <div class="wds-bj"></div>
              <el-form-item class="wds-frame-form-item" label="领用审核说明" prop="interviewStatus">
                {{dataForm.autitorDesc}}
              </el-form-item>
            </div>
          </el-col>
        </el-row>

        <el-row class="wds-el-row" type="flex">
          <el-col :span="12">
            <div class="wds-frame-l">
              <div class="wds-bj"></div>
              <el-form-item class="wds-frame-form-item" label="报修日期">
                {{dataForm.repairsTime}}
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="12">
            <div class="wds-frame-l">
              <div class="wds-bj"></div>
              <el-form-item class="wds-frame-form-item" label="申请报修说明" prop="signInTime">
                {{dataForm.repairsDesc}}
              </el-form-item>
            </div>
          </el-col>
        </el-row>
        <el-row class="wds-el-row" type="flex">
          <el-col :span="12">
            <div class="wds-frame-l">
              <div class="wds-bj"></div>
              <el-form-item class="wds-frame-form-item" label="报修审核人" prop="interviewStatus">
                {{dataForm.createBy2}}
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="12">
            <div class="wds-frame-l">
              <div class="wds-bj"></div>
              <el-form-item class="wds-frame-form-item" label="报修审核时间" prop="interviewScore">
                {{dataForm.createTime2}}
              </el-form-item>
            </div>
          </el-col>
        </el-row>
        <el-row class="wds-el-row" type="flex">
          <el-col :span="24">
            <div class="wds-frame-l">
              <div class="wds-bj"></div>
              <el-form-item class="wds-frame-form-item" label="报修审核说明" prop="interviewStatus">
                {{dataForm.autitorDesc2}}
              </el-form-item>
            </div>
          </el-col>
        </el-row>
        <el-row class="wds-el-row2" type="flex">
          <el-col :span="7">
            <div class="wds-frame-l">
              <div class="wds-bj"></div>
              <el-form-item class="wds-frame-form-item" label="报修附件" prop="assetsImg">
                <template >
                  <div style="display: flex; align-items: center;">
                    <img :src="dataForm.repairsPic"  style="max-width: 110%; max-height: 110px; object-fit: contain; margin-left: 10px;">
                  </div>
                </template>
              </el-form-item>
            </div>
          </el-col>
        </el-row>
        <el-row class="wds-el-row" type="flex">
          <el-col :span="24">
            <div class="wds-frame-l">
              <div class="wds-bj"></div>
            </div>
          </el-col>
        </el-row>
      </el-row>
    </el-form>

    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取消</el-button>
    </span>
  </el-dialog>
</template>

<script>
  export default {
    data () {
      return {
        visible: false,
        dataForm: {
          assetsId: 0,
          assetsName: '',
          assetsNum: '',
          assetsBuytime: '',
          assetsAdmin: '',
          assetsImg: '',
          assetsStatus: '',
          assetsDesc: '',
          receiveId: 0,
          userName: '',
          receiveTime: '',   // 领用时间
          createBy: '',  // 领用审核人
          createTime: '',  // 领用审核时间
          receiveDesc: '', // 领用说明 申请人写的
          autitorDesc: '',  // 领用审核意见
          repairsDesc: '',  // 报修说明  申请人写
          createBy2: '', // 维修审核人
          autitorDesc2: '', // 维修审核意见
          createTime2: '', // 维修审核时间
          repairsTime: '', // 报修时间
          createStatus: '', // 审核状态
          repairsPic: '',  // 报修照片
          scrapTime: ''
        },
        dataRule: {
          assetsName: [
            { required: true, message: '资产编号不能为空', trigger: 'blur' }
          ],
          userName: [
            { required: true, message: '领用人不能为空', trigger: 'blur' }
          ],
          receiveTime: [
            { required: true, message: '领用日期不能为空', trigger: 'blur' }
          ],
          createBy: [
            { required: true, message: '审核人不能为空', trigger: 'blur' }
          ],
          createTime: [
            { required: true, message: '审核时间不能为空', trigger: 'blur' }
          ],
          receiveDesc: [
            { required: true, message: '备注不能为空', trigger: 'blur' }
          ]
        }
      }
    },
    methods: {
      init (row) {
        console.log(row, 'xx')
        this.visible = true
        // 基本资产信息
        this.dataForm = row
       /*  // 资产领用信息
        this.dataForm.receiveId = row.receiveId || 0
        this.$nextTick(() => {
          this.$refs['dataForm'].resetFields()
          if (this.dataForm.receiveId) {
            this.$http({
              url: this.$http.adornUrl(`/assets/receive/info/${row.receiveId}`),
              method: 'get',
              params: this.$http.adornParams()
            }).then(({data}) => {
              if (data && data.code === 0) {
                console.log('data', data)
                this.dataForm.assetsName = data.receive.assetsName  // 资产名
                this.dataForm.userName = data.receive.userName     // 使用人
                this.dataForm.receiveTime = data.receive.receiveTime   // 申请时间
                this.dataForm.receiveDesc = data.receive.receiveDesc  // 申请理由
                this.dataForm.createBy = data.receive.createBy        // 审核人
                this.dataForm.createTime = data.receive.createTime    // 审核时间
                this.dataForm.autitorDesc = data.receive.autitorDesc // 领用审核意见
                this.dataForm.repairsDesc = data.receive.repairsDesc // 报修描述
                this.dataForm.repairsTime = data.receive.repairsTime // 报修时间
                this.dataForm.createBy2 = data.receive.createBy2 // 报修审核人
                this.dataForm.autitorDesc2 = data.receive.autitorDesc2 // 报修意见
                this.dataForm.createTime2 = data.receive.createTime2 // 报修审核时间
                this.dataForm.createStatus = data.receive.createStatus // 资产状态
                this.dataForm.repairsPic = data.receive.repairsPic
                this.dataForm.scrapTime = data.receive.scrapTime
              }
            })
          }
        }) */
      }
    }
  }
</script>
<style>
.wds-form-top {
  margin-top: 8px;
}
.wds-frame {
  margin-left: 15px;
  margin-right: 15px;
  border-top: 1px solid rgba(184, 194, 215, 0.4);
  border-right: 1px solid rgba(184, 194, 215, 0.4);
}
.wds-frame-l {
  position: relative;
  width: 100%;
  height: 100%;
  border-left: 1px solid rgba(184, 194, 215, 0.4);
  border-bottom: 1px solid rgba(184, 194, 215, 0.4);
}
.wds-frame-form-item .el-form-item__label {
  padding-top: 6px;
  padding-left: 4px;
  line-height: 20px !important;
  width: 130px !important;
  color: #054999;
}
.wds-bj{
  width: 140px;
//background: #fafafa;
//background-color: transparent;
  border-right: 1px solid rgba(184, 194, 215, 0.4);
  height: 100%;
  position: absolute;
  margin-top: 0px;
}
.wds-frame-form-item{
  max-height: 25px;
  padding-top: 6px;
  padding-left: 4px;
  line-height: 20px !important;
  color: #054999;
}
.layui-layer-min {
  display: none !important;
}
/deep/ .el-divider .el-divider__text {
  font-size: 18px !important;
  font-weight: 800;
}

.wds-el-row2{
  height: 120px;

}

</style>

